var arr = new Array(1,2,3,"4", true, [124, 125]);
var arr1 = [1,2,3];
console.log('🚀 - arr1[0]:', arr1[0]);
console.log('🚀 - arr.length:', arr.length);
arr[10] = 10;
console.log('🚀- arr[9]:', arr[9]);
console.log('🚀- arr[10]:', arr[10]);
console.log('🚀- arr.length:', arr.length);

// 追加元素
arr.push('a','b')
// 删除元素  索引开始位置 删除的元素个数
arr.splice(0,2);
// 遍历数组
for(var i = 0;i < arr.length;i++){
    console.log('arr['+i+']:'+arr[i]);
}
// arr.forEach(
//     function(item){
//     console.log('🚀 - arr.forEach - item:', item)
//     }
// )
arr.forEach(
    (item) => {
        console.log('🚀 => item:', item)
    }
);
// var fun1 = function(item){
//     console.log('🚀 - item:', item)
// }
// arr.forEach(fun1);

var str = new String("Hello");
console.log('🚀 - str:', str)
console.log('🚀 - str.length:', str.length);
var str2 = new String("hello");
console.log('🚀 - str2:', str2)
console.log('🚀 - str2.length:', str2.length);

var stu1 = {
    name:"s1",
    age:10,
    gender:"女",
    likes:['🏀','🏓','🎸','📷'],
    //  方法
    eat: function(){
        console.log("公主请吃饭");
    }
}

console.log('🚀 - stu1.name:', stu1.name)
stu1.eat()